@echo off
pushd %windir%\inf
if not exist digirlpt md digirlpt
if exist digirp.inf move /Y digirp.inf digirlpt & echo digirp.inf
if exist digirp.pnf move /Y digirp.pnf digirlpt & echo digirp.pnf
if exist digirprt.inf move /Y digirprt.inf digirlpt & echo digirprt.inf
if exist digirprt.pnf move /Y digirprt.pnf digirlpt & echo digirprt.pnf

for %%i in (oem*.inf) do call :MoveDeviceOemFiles %%~ni
for %%i in (oem*.inf) do call :MovePortOemFiles %%~ni
popd
goto :EOF

:MoveDeviceOemFiles
findstr /M CatalogFile=digirlpt.cat %1.inf
if (%ERRORLEVEL%) == (0) move /Y %1.inf digirlpt
if (%ERRORLEVEL%) == (0) if exist %1.pnf move /Y %1.pnf digirlpt & echo %1.pnf
goto :EOF

:MovePortOemFiles
findstr /M CatalogFile=digirlpt.cat %1.inf
if (%ERRORLEVEL%) == (0) move /Y %1.inf digirlpt
if (%ERRORLEVEL%) == (0) if exist %1.pnf move /Y %1.pnf digirlpt & echo %1.pnf
goto :EOF
